<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>我的购物车</title>
    <link href="css/style.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery-1.7.min.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script type="text/javascript">

        //全选、反选
        function selectAll() {
            var cid =  document.getElementById("cid");
            var cids = document.getElementsByClassName("cids");
            for (var i = 0; i <cids.length; i++) {
                if (cid.checked==true){
                    cids[i].checked=true;
                }else{
                    cids[i].checked=false;
                }
            }
        }

        function jiesuan() {
            var cids = document.getElementsByClassName("cids");
            var arr = [];
            for (var i = 0; i <cids.length; i++) {
                if (cids[i].checked==true){
                   arr.push(cids[i].value);
                }
            }
            var cids2 = arr.toString();
            window.location.href="OrderController/jiesuan?cids="+cids2;
        }

        //批量删除
        function deleteBacth() {
            var cids = document.getElementsByClassName("cids");
            var arr = [];
            for (var i = 0; i <cids.length; i++) {
                if (cids[i].checked==true){
                    arr.push(cids[i].value);
                }
            }
            var cids2 = arr.toString();
            var f = confirm("你要删除"+cids2+"");
            if (f){
                window.location.href="OrderController/deleteBacth?cids="+cids2;
            }

        }


    </script>

</head>
<body class="index">
<div class="top_ad"><div class="w1200"><a href="#" id="close"></a></div></div>

<div class="top">
    <div class="w1200">
        <div class="left">
            ${loginUser.nickname}您好，欢迎光临飞飞商城！
                <c:choose>
                    <c:when test="${loginUser.nickname!=null}">
                        <a href="/login">[退出]</a>
                    </c:when>
                    <c:otherwise>
                    <a href="login.jsp">[登录]</a></div>
                </c:otherwise>
                </c:choose>
        </div>
        <div class="right">
            <a href="#">我的会员中心</a>|
            <a href="#">收藏夹</a>|
            <a href="#">服务中心</a>|
            <a href="#">在线客服</a>|
            <a href="/OrderController/findUserOrder">购物车</a>
        </div>
        <div class="clear"></div>
    </div>
</div>

<div class="head">
    <div class="w1200">
        <div class="logo"><a href="#"></a></div>
        <div class="search">
            <form action="#" class="form">
                <input type="text" value="输入商品关键字" name="keyword" class="txt" onfocus="if(value=='输入商品关键字') {value=''}" onblur="if(value=='') {value='输入商品关键字'}"/>
                <input type="submit" value="搜索" class="sub"/>
            </form>
            <p><a href="#">iphone6s</a>|<a href="#">面膜</a>|<a href="#">婚庆床品</a>|<a href="#">运动鞋</a>|<a href="#">眼霜</a>|<a href="#">月饼</a>|<a href="#">智能手机</a>|<a href="#">连衣裙</a></p>
        </div>
        <div class="s_r">
            <dl>
                <dt><p><a href="/OrderController/findUserOrder">购物车</a></p></dt>
                <dd>客服电话：<b>400-0000-000</b></dd>
            </dl>
        </div>
        <div class="clear"></div>
    </div>
</div>

<div class="menu">
    <div class="w1200">
        <div class="item" id="nav"><a href="#" class="nav">全部商品分类</a>
            <div class="nav_son">
                <ul>
                    <li class="li01"><a href="#">功能产品</a></li>
                    <li class="li02"><a href="#">服装箱包</a></li>
                    <li class="li03"><a href="#">美妆护肤</a></li>
                    <li class="li04"><a href="#">珠宝饰品</a></li>
                    <li class="li05"><a href="#">数码家电</a></li>
                    <li class="li06"><a href="#">食品茶酒</a></li>
                    <li class="li07"><a href="#">运动体育</a></li>
                    <li class="li08"><a href="#">家居家纺</a></li>
                    <li class="li09"><a href="#">生活服务</a></li>
                    <li class="li10"><a href="#">其他</a></li>
                </ul>
            </div>
        </div>
        <div class="item"><a href="/GoodsController/GetAll" class="home">商城首页</a></div>

    </div>
</div>


<div class="w1200">
    <div class="position"><a href="#">首页</a> > <a href="#">购物车</a></div>
    <div class="shopcar">
        <div class="shop_lc"><span class="sp01">我的购物车</span><span class="sp02">填写提交信息表单</span><span class="sp03">在线支付</span></div>
        <dl>
            <dt><span>我的购物车</span></dt>
            <dd>
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                    <tr class="tr_t">
                        <td width="4%"><input type="checkbox" id="cid" onclick="selectAll()"/></td>
                        <td width="4%">全选</td>
                        <td width="35%">商品</td>
                        <td width="26%">单价</td>
                        <td width="6%">数量</td>
                        <td width="11%">操作</td>
                    </tr>
                    <c:forEach items="${userCarList}" var="gl">
                        <tr class="tr_c">
                            <td><input type="checkbox" class="cids" value="${gl.id}"/></td>
                            <td colspan="2">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="85%"><a href="#" class="title">${gl.gTitle}</a></td>
                                    </tr>
                                </table>
                            </td>
                            <td class="price">￥${gl.currentPrice}</td>
                            <td>${gl.buyNumber}</td>
                            <td><a href="#">删除</a></td>
                        </tr>
                    </c:forEach>
                    <tr class="tr_d">
                        <td colspan="7">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="75%"><span class="del"><button onclick="deleteBacth()">删除选中商品</button></span></td>
                                    <td width="14%" class="all_price">合计：￥${allPrice}</td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <div class="clear"></div>
            </dd>
        </dl>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="go_tb">
            <tr>
                <td width="20%"><a href="/GoodsController/GetAll" class="go_buy">继续购物</a></td>
                <td width="63%">&nbsp;</td>
                <td width="17%" align="right"><button onclick="jiesuan()" class="code">结 算</button></td>
            </tr>
        </table>
        <div class="clear"></div>
    </div>
</div>

<!--footer-->
<div class="footer">
    <div class="f_bz">
        <div class="w1200">
            <dl class="dl01">
                <dt>正品保证</dt>
                <dd>正品护航  购物无忧</dd>
            </dl>
            <dl class="dl02">
                <dt>你消费 我买单</dt>
                <dd>返现购物商城</dd>
            </dl>
            <dl class="dl03">
                <dt>品类丰富</dt>
                <dd>品类齐全 轻松购物</dd>
            </dl>
            <dl class="dl04">
                <dt>特色服务体验</dt>
                <dd>为您呈现不一样的服务</dd>
            </dl>
            <div class="clear"></div>
        </div>
    </div>
    <div class="f_nav">
        <div class="w1200">
            <dl>
                <dt>新手指南</dt>
                <dd>
                    <a href="#">注册新用户</a>
                    <a href="#">商品订购流程</a>
                    <a href="#">会员注册协议</a>
                </dd>
            </dl>
            <dl>
                <dt>付款方式</dt>
                <dd>
                    <a href="#">支付宝支付</a>
                    <a href="#">网上银行支付</a>
                    <a href="#">货到付款</a>
                </dd>
            </dl>
            <dl>
                <dt>常见问题</dt>
                <dd>
                    <a href="#">订单状态</a>
                    <a href="#">发票说明</a>
                </dd>
            </dl>
            <dl>
                <dt>售后服务</dt>
                <dd>
                    <a href="#">退换货政策</a>
                    <a href="#">退换货流程</a>
                    <a href="#">退款说明</a>
                    <a href="#">退换货申请</a>
                </dd>
            </dl>
            <dl>
                <dt>客服中心</dt>
                <dd>
                    <a href="#">常见问题</a>
                    <a href="#">联系客服</a>
                    <a href="#">投诉与建议</a>
                </dd>
            </dl>
            <div class="ewm"><img src="images/home/ico35.png"/></div>
            <div class="ewm"><img src="images/home/ico38.png"/></div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="w1200">
        <div class="bottom">
            <a href="#">关于我们</a>|<a href="#">帮助中心</a>|<a href="#">法律声明</a>|<a href="#">用户协议</a>|<a href="#">联系我们</a>|<a href="#">人才招聘</a>|<a href="#">站点地图</a>

            <p>网络文化经营许可证：粤网文[2015]0295-065号<br />© 2015 深圳易易城科技网络有限公司. 粤ICP备15042543号</p>
            <p class="p02"><img src="images/home/ico25.jpg"/><img src="images/home/ico26.jpg"/><img src="images/home/ico27.jpg"/><img src="images/home/ico36.jpg"/><img src="images/home/ico37.jpg"/></p>
        </div>
    </div>
</div>

</body>
</html>